package com.zhny.controller;

import com.zhny.service.TickerService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/test")
@RestController
public class UserController {
    //拿到远程的provider-server提供的服务
      //dubbo的注解用于引用服务，引用服务方式有两种：1.Pom坐标，2.需要定义路径相同的接口名
    @Reference
    TickerService tickerService;

    @RequestMapping("/sss")
    public void buyTicket(){

        String ticket = tickerService.getTicket();
        System.out.println("在注册中心拿到："+ticket);
    }
}
